package com.example.spring_data_jpa.service;


import com.example.spring_data_jpa.entity.Goods;
import com.example.spring_data_jpa.repository.GoodsRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class GoodsService {


    private final GoodsRepository goodsRepository;


    public Goods findById(String id) {
        return goodsRepository.findById(id).orElse(null);
    }

    public void save(Goods goods) {
        goodsRepository.save(goods);
    }
}
